package com.qcby.pushservice.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qcby.pushservice.base.bo.SendSmsBO;
import com.qcby.pushservice.base.mapper.MessageTemplateMapper;
import com.qcby.pushservice.base.moudle.AbstSendSms;
import com.qcby.pushservice.base.po.MessageTemplatePO;
import com.qcby.pushservice.base.service.ISendService;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 发送服务impl
 *
 * @author cong.zhen
 * @date 2023/05/09
 */
@Service
public class SendServiceImpl implements ISendService {


//    @Resource
//    private AbstSendSms abstSendSms;

    @Resource
    private MessageTemplateMapper messageTemplateMapper;

    @Override
    public SendSmsBO sendSms(SendSmsBO sendSmsBO) {
//        /**查询消息模板默认通道**/
//        MessageTemplatePO messageTemplatePO = messageTemplateMapper.selectOne(new LambdaQueryWrapper<MessageTemplatePO>().eq(MessageTemplatePO::getMessageCode, sendSmsBO.getMessageCode()));
//        AbstSendSms abstSendSms = this.abstSendSms.channelMap.get(messageTemplatePO.getDefaultChannel());
//        AbstSendSms abstSendSms = new AbstSendSms() {
//        }
//        abstSendSms.pre(sendSmsBO);
        SendSmsBO smsBO = new SendSmsBO();
        smsBO.setSend(true);
        smsBO.setCode("0000");
        smsBO.setDesc("发送成功");
        return smsBO;
    }
}
